$(".button").click(function(){
    return(checkemail() && checkpassword())
})

//验证邮箱
$(".email-name").blur(checkemailTip);
function checkemailTip(){
    var email = $(".email-name").val()
    if(email == null || email == ""){
        $("#emailTip").text("手机号/邮箱不能为空")
    }else if((!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/||!/^[1][3,4,5,7,8][0-9]{9}$/).test(email)){
        $("#emailTip").text("请输入正确格式的手机号/邮箱")
        }
    else{
        $("#emailTip").text("")
    }
}
function checkemail(){
    var email = $(".email-name").val()
    if(email == null || email == ""){
        alert("手机号/邮箱不能为空")
        return false
    }else if(!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(email)){
        alert("请输入正确格式的手机号/邮箱")
        return false
    }
    else{
        return true
    }
}

//验证密码
$(".word-pass").blur(checkpasswordTip);
function checkpasswordTip(){
    var password = $(".word-pass").val()
    if(password == null || password == ""){
        $("#passwordTip").text("密码不能为空")
    }else{
        $("#passwordTip").text("")
    }
}
function checkpassword(){
    var password = $(".word-pass").val()
    if(password == null || password == ""){
        alert("密码不能为空")
        return false
    }else{
        return true
    }
}